<template>
  <router-view :key="componentKey" />
</template>

<script setup>
import useSettingsStore from "@/store/modules/settings";
import { handleThemeStyle } from "@/utils/theme";
//counter
import useCounterStore from "@/store/counter";
const counter = useCounterStore();
//router
import { useRouter } from "vue-router";
const router = useRouter();

//data
const componentKey = ref(0);

onMounted(() => {
  counter.init();
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme);
  });
});

// 监听当前路由
watch(
  () => router.currentRoute.value,
  (newValue) => {
    componentKey.value++;
  },
  { immediate: true }
);
</script>

<style lang="scss">
.el-form-item--default {
  margin-bottom: 13px !important;
}
.descriptionsLabel150 {
  width: 150px;
  flex-shrink: 0;
}
.errColor {
  color: #f56c6c !important;
}

.el-autocomplete {
  width: 100%;
}

.el-form {
  .el-form-item {
    .el-form-item__label {
      font-weight: initial;
    }
  }
}

.textCenter {
  text-align: center;
}

.button {
  cursor: pointer;
  color: var(--el-color-primary);
  font-size: 14px;
  font-weight: 500;
}

.grids {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0px, 1fr));
}

.gridColumns5 {
  grid-template-columns: repeat(5, minmax(0px, 1fr));
}

.gridColumns6 {
  grid-template-columns: repeat(6, minmax(0px, 1fr));
}

.gridColumns3 {
  grid-template-columns: repeat(3, minmax(0px, 1fr));
}

.gridColumns2 {
  grid-template-columns: repeat(2, minmax(0px, 1fr));
}

.el-cascader {
  width: 100%;
}

.el-dialog:not(.is-fullscreen) {
  margin-top: 0 !important;
}
.el-dialog {
  border-radius: 6px !important;
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  .el-dialog__header {
    background-color: #c8d8f1;
    margin-right: 0;

    .el-dialog__title {
      font-size: 16px;
      font-weight: bold;
    }
  }
}

.mainCom {
  width: 100%;
}

.el-select {
  width: 100%;
}

.el-input {
  width: 100%;
}

.el-tabs {
  .el-tabs__content {
    overflow: inherit;
  }
}

.flex {
  display: flex;
}

.flexWrap {
  flex-wrap: wrap;
}

.alignCenter {
  align-items: center;
}

.justifyBetween {
  justify-content: space-between;
}

.gap15 {
  gap: 15px 15px; //上下间距 左右间距
}

.justifyCenter {
  justify-content: center;
}

.justifyEnd {
  justify-content: flex-end;
}

ul {
  margin: 0;
  padding: 0;

  li {
    list-style: none;
  }
}

.bold {
  font-weight: bold;
}

.shrink {
  flex-shrink: 0;
}

.descriptionsLabel120 {
  .el-descriptions__label {
    width: 120px;
  }
}
.fz12 {
  font-size: 12px;
}
.fz14 {
  font-size: 14px;
}
.fz16 {
  font-size: 16px;
}
.fz18 {
  font-size: 18px;
}
.fz20 {
  font-size: 20px;
}
.width100 {
  width: 100%;
}
.whiteSpace {
  white-space: pre-wrap;
}
/* 为合计行添加整体样式 */
.el-table__footer-wrapper {
  font-weight: bold;
}
</style>
